#include <REGX52.H>
#include "Delay.h"

	sbit RCK   = P3^5;    //RCLK
	sbit SCK   = P3^6;	  //SRCLK
	sbit SER   = P3^4;	  //SER

void MatrixLED_Init()
{
	SCK = 0;
	RCK = 0;
}



void _H74HC595_WriteByte(unsigned char Byte)
{
	unsigned char i = 0;
	for (i = 0;i < 8;i++)
	{
//		1位   0x..  这种情况下等号右边非0即1
		SER = Byte & (0x80 >> i);//注意理解!!!
		
		SCK = 1;//上升沿移位
		SCK = 0;//准备下一次移位
	}
	RCK = 1;//上升沿锁存
	RCK = 0;
}



void MatrixLED_ShowColRow(unsigned char Col,Row)
{
	_H74HC595_WriteByte(Row);
	P0 = ~(0x80 >> Col);
	Delay(1);
	P0 = 0xFF;
}











